install.packages('devtools')
Note that whenever the rockyIntertidal package is
updated, you can rerun this code to install the latest version.
library(devtools)
install_github("KateMMiller/rockyIntertidal")
library(rockyIntertidal)
Note that R is not able to connect to files on Sharepoint or MS Teams
(b/c Teams also stores all files on Sharepoint). That means you need to
store data package files on your local machine or on a server (e.g. NETN
Z drive). Currently, the importData() function only imports
queries from the rocky intertidal backend database. Once the data
package is completed, the import function will be updated to be able to
import csvs, either as individual files or as a zipped file. The latest
backend (as far as I know) is on the MS Team here: NPS ACAD Intertidal
Zone > Data_Pipeline > Files >
NETN_RockyIntertidal_Database_be_20231011.mdb.
Note that this is the link to the folder, not the actual database.
You’ll need to download the database (or move it to the Z drive).
The default option for importing data adds the data package views
(i.e., flatfiles) to an environment called ROCKY to your Environment
work space (i.e. Environment tab in top right panel). If you would
rather import each individual view into your R session, specify with the
new_env argument (e.g., importData(new_env = F)).
Option 1. Import data via data package database file on your computer
importData(type = 'file',
path = "C:/NETN/R_Dev/data/rocky/NETN_RockyIntertidal_Database_be_20231011.mdb")
Option 2. Import data via data package database DSN (Data Source Name) on your computer. Note that this is the default setting. As long as you have a named DSN called “rocky_BE” that links to the latest rocky backend database, the code below will run. See Setting up DSN tab for how to set up DSN.
importData() # easiest
importData(type = 'DSN', odbc = "rocky_BE") # equivalent to line above
The water temperature data is stored as separate csvs and so has a
different import function and process. The temp logger files will go
into your ROCKY environment named the 6 letter location code. The
buoy = T loads the buoy data for each park to the ROCKY
environment. The simplify = T simplifies the datasets to
include only 1 logger measurement per high tide event (for water temp)
and 1 buoy record per day. All plotting functions require the simplified
data. The latest compiled files are on the Z drive here:
“Z:/PROJECTS/MONITORING/Rocky_Intertidal/NETN/5_Data/Data_Files/Temperature/Compiled_HT_water_temps_2011-2022/”.
This reminds me that I need to update the data to include 2023.
path = "Z:/PROJECTS/MONITORING/Rocky_Intertidal/NETN/5_Data/Data_Files/Temperature/Compiled_HT_water_temps_2011-2022/"
importWaterTemp(path = path, buoy = T, simplify = T)
The functions in the rockyIntertidal package are
designed to work with the views, and are the best way to interact with
the data to query by park, site, site type, year, parameter, etc.
However, if you want to view the raw data, and you imported the data
into the ROCKY environment, you can access them with the code below:
# See list of the views
names(ROCKY)
# View one of the views
View(ROCKY$Bolts)
# Assign a view to a data frame named bolts in R. Interact with bolts the way you would work with any normal data frame in R.
bolts <- ROCKY$Bolts
While this works, the better approach is to use the “getter” functions within the R package, which access the same files, but allow you to also query data based on park, location, years, plot name, species, etc. See the specific getter function tabs for details.
If you want to use the print_head() function that shows
output in the markdown, run the code below. This makes the results print
cleaner in the markdown report. For your purposes, you can just run:
head(dataframe).
print_head <- function(df){
knitr::kable(df[1:6,]) |> #, table.attr = "style='width:60%;'") |>
kableExtra::kable_classic(full_width = F, font_size = 12,
bootstrap_options = c("condensed"))
}
If you’re contributing to the package, you’ll need to use build tools to build and install the package to test changes before posting to GitHub. Unfortunately Software Center installs RTools44 in C:/Program Files/, not C:/, which is where RStudio looks for it by default. The following code helps RStudio find RTools. You may occasionally have to rerun this code (except for the usethis line), so keep it handy. You know when you have to rerun the code when you try to rebuild a package, and a window pops up to ask if you want to install missing build files.
# Set r environ to find rtools on opening
usethis::edit_r_environ()
Sys.setenv(PATH = paste("C:\\PROGRA~1\\Rtools44\\bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:\\PROGRA~1\\Rtools44\\mingw_$(WIN)\\bin\\")
The functions in rockyIntertidal have help documentation
like any R package. To view the help, you can go to the Packages tab and
click on rockyIntertidal (see below). That will show you all the
functions in the package. Clicking on individual functions will take you
to the help documentation for that function.
You can also see the help of a function by running, for example:
?importData
If rockyIntertidal isn’t loaded yet, you’d run:
?rockyIntertidal::importData
Each function’s help includes a Description, Usage (i.e. function arguments and their defaults), Argument options/definitions, and several examples showing how the function can be used.
This is where you come in! If you notice typos or can think of better descriptions, examples, error messages, etc., please send them my way! After we’re more comfortable with R packages and get versed on GitHub, you’ll be able to make those changes directly in the package. For now, you can just send me your suggestions and I’ll make the changes.
Finally, if you ever want to peak under the hood at the function, you can view it several ways.View code in the GitHub katemmiller/rockyIntertidal repo. The functions are in the R folder.
print_head(getBolts(location = "CALISL", plotType = "Photoplot"))
| Bolt_ID | Plot_ID | Site_Name | Site_Code | State_Code | Loc_Name | Loc_Code | Plot_Name | Plot_Type | Target_Species | Label | Bolt_UTM_E | Bolt_UTM_N | Bolt_UTM_Datum | Bolt_UTM_Zone | Bolt_NAVD88_Elev | Bolt_MLLW_Elev | ListOrder | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 77534CF3-B379-4EDA-ABF3-65335904971B | BA9B0150-724F-4CF1-83FA-B0EFB0D51D6F | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A1 | Photoplot | Ascophyllum | A1 label | 343919.7 | 343919.7 | NAD83 | 19N | 0.095710 | 1.773710 | 1.0 | NA |
| B30A77DB-3F52-4EAA-ADFE-C928E40022BC | BA9B0150-724F-4CF1-83FA-B0EFB0D51D6F | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A1 | Photoplot | Ascophyllum | A1 bolt 01 | 343919.7 | 343919.7 | NAD83 | 19N | 0.107605 | 1.785605 | 1.1 | NA |
| 76E44039-730E-445F-8CA0-5CA2A165AD31 | BA9B0150-724F-4CF1-83FA-B0EFB0D51D6F | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A1 | Photoplot | Ascophyllum | A1 bolt 02 | 343920.2 | 4689533.2 | NAD83 | 19N | -0.063546 | 1.614454 | 1.2 | NA |
| 806E1DBE-3E60-4BF0-BB05-FDC1E12BF77E | BA9B0150-724F-4CF1-83FA-B0EFB0D51D6F | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A1 | Photoplot | Ascophyllum | A1 bolt 03 | 343920.3 | 4689533.9 | NAD83 | 19N | -0.140115 | 1.537885 | 1.3 | NA |
| 207948E2-944D-47C2-8E73-33FD82FEB2E3 | BA9B0150-724F-4CF1-83FA-B0EFB0D51D6F | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A1 | Photoplot | Ascophyllum | A1 bolt 04 | 343919.9 | 343919.9 | NAD83 | 19N | -0.107108 | 1.570892 | 1.4 | NA |
| 03DA4ECC-E9B1-4FB4-ACF2-8BBD5EA00E35 | 068910BC-CD38-4A30-9C39-31456231CBA9 | Boston Harbor NRA | BOHA | MA | Calf Island | CALISL | A2 | Photoplot | Ascophyllum | A2 label | 343918.1 | 343918.1 | NAD83 | 19N | 0.257231 | 1.935231 | 2.0 | NA |
These are the transect point intercept distances before elevation is
determined. Elevation is calculated in sumPISpecies()
print_head(getPIBoltDistance()) # PointIntercept_BoltDist_C
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Plot_Name | Label | Elevation_MLLW_m | Distance_m | Notes_Event |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 01 | 3.487006 | 0.00 | Sampled on 6/20/13 |
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 02 | 3.184000 | 1.04 | Sampled on 6/20/13 |
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 03 | NA | 1.53 | Sampled on 6/20/13 |
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 04 | 2.668736 | 3.16 | Sampled on 6/20/13 |
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 05 | 2.543000 | 3.89 | Sampled on 6/20/13 |
| Acadia NP | ACAD | Schoodic Point | SCHPOI | 2013-06-19 | 2013 | FALSE | T1 | T1 bolt 06 | 2.958020 | 4.95 | Sampled on 6/20/13 |
print_head(getPISpecies(location = c("BASHAR", "OTTPOI"))) # PointIntercept_SppDetections
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Plot_Name | PI_Distance | Spp_Code | Spp_Name | Event_ID | Plot_ID |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 0.0 | ROCK | Rock | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 0.3 | ROCK | Rock | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 0.6 | WATER | Water | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 0.9 | ROCK | Rock | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 1.2 | ROCK | Rock | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | T1 | 1.5 | ROCK | Rock | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 1C404B99-06C5-4963-8271-9ED1721A57E9 |
print_head(getPhotoCover(location = c("BASHAR", "OTTPOI"), target_species = "Barnacle"))
| Site_Code | Loc_Code | Plot_Name | Target_Species | Bolt_UTM_E | Bolt_UTM_N | Bolt_MLLW_Elev | Site_Name | Loc_Name | Start_Date | Year | Date_Scored | QAQC | Spp_Code | Spp_Name | Category | Perc_Cover | Notes | Scorer | Event_ID | Plot_ID |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | OTHINV | Other Invertebrate | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | CHOMAS | Irish Moss (Chondrus / Mastocarpus) | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | CRUCOR | Crustose coraline | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | OTHPLA | Other Plant | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | ALGBRO | Other Algae - Brown | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
| ACAD | BASHAR | B1 | Barnacle | 554140.1 | 554140.1 | 2.365207 | Acadia NP | Bass Harbor | 2013-06-21 | 2013 | 2013-09-03 | FALSE | ALGGRE | Other Algae - Green | Species Group | 0 | NA | {1EE29925-05EE-4AEF-967C-2F4D5C2A4724} | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | B0B857F3-2B60-42E5-A24D-27173424DB14 |
print_head(getMotileInvertCounts(park = "ACAD", years = 2013:2021, species = c("LITLIT", "LITOBT", "LITSAX")))
| Site_Name | Site_Code | State_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Plot_Name | Spp_Name | Spp_Code | Damage | No.Damage | Subsampled | Event_ID | Plot_ID | Bolt_UTM_E | Bolt_UTM_N | Bolt_MLLW_Elev |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | A1 | Common periwinkle (Littorina littorea) | LITLIT | 0 | 3 | No | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 0 | 6 | No | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | A1 | Rough periwinkle (Littorina saxatilis) | LITSAX | 0 | 0 | No | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Ascophyllum | A1 | Common periwinkle (Littorina littorea) | LITLIT | 0 | 2 | No | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 0 | 1 | No | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Ascophyllum | A1 | Rough periwinkle (Littorina saxatilis) | LITSAX | 0 | 0 | No | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | 67F474C4-53AA-42A5-AE1C-29D22B47D021 | 554093.7 | 4897051 | 2.786703 |
print_head(getMotileInvertMeas(location = "SHIHAR", years = 2013:2019))
| Site_Name | Site_Code | State_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Plot_Name | Spp_Name | Spp_Code | Measurement | Event_ID | Plot_ID |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 7 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 8 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 10 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 10 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Common periwinkle (Littorina littorea) | LITLIT | 10 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | A1 | Smooth periwinkle (Littorina obtusata) | LITOBT | 10 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | 58ED9BC5-B195-4C87-A164-3A60C2A1913F |
print_head(getEchinoCounts(park = "ACAD", years = 2013:2021, species = "STRDRO"))
| Site_Name | Site_Code | State_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Plot_Name | Event_ID | Plot_ID | Spp_Code | Count | Spp_Name |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Echinoderms | X1 | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | 8BABA85C-BDE8-46DB-9547-51FD78420F9B | STRDRO | 0 | Strongylocentrotus droebachiensis (sea urchin) |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Echinoderms | X2 | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | E5103CAF-94F8-4AA8-939C-4DFA1AA86255 | STRDRO | 0 | Strongylocentrotus droebachiensis (sea urchin) |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Echinoderms | X3 | 3F21A576-2949-4C40-A1F6-C22EE46A8DD7 | A73241A6-57E8-483B-A78B-5DEC8DC4D51B | STRDRO | 0 | Strongylocentrotus droebachiensis (sea urchin) |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Echinoderms | X1 | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | 8BABA85C-BDE8-46DB-9547-51FD78420F9B | STRDRO | 0 | Strongylocentrotus droebachiensis (sea urchin) |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Echinoderms | X2 | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | E5103CAF-94F8-4AA8-939C-4DFA1AA86255 | STRDRO | 12 | Strongylocentrotus droebachiensis (sea urchin) |
| Acadia NP | ACAD | ME | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | Echinoderms | X3 | 24C1A879-5BF9-42AB-9FD1-DC86EA201C6F | A73241A6-57E8-483B-A78B-5DEC8DC4D51B | STRDRO | 0 | Strongylocentrotus droebachiensis (sea urchin) |
print_head(getEchinoMeas(location = "SHIHAR", years = 2013:2019))
| Site_Name | Site_Code | State_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Plot_Name | Spp_Name | Spp_Code | Measurement | Event_ID | Plot_ID |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 25 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 55 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 56 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 57 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 58 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
| Acadia NP | ACAD | ME | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | X3 | Sea urchin (S. droebachiensis) | STRDRO | 64 | 9A29BB59-23EB-47F2-AA34-38DEEFF6409C | F05658BD-244E-44A4-ADDA-3187937046BD |
For every get function, there’s a sum function that summarizes the data. This is typically at the location level for a given species and year. For example, averaging across the 3 point intercept transects, or averaging percent cover across the 5 barnacle photoplots. Summary functions are demonstrated below.
This the function where elevation is calculated for point intercept distances along the transects.
print_head(sumPISpecies(location = c("BASHAR", "OTTPOI")))
## Warning in sumPISpecies(location = c("BASHAR", "OTTPOI")): There were 5 bolt distance/elevation combinations are impossible and cannot calculate slope between bolts. Either the tape didn't follow ground contour between this and the following bolt or a recording error occured. Slope was converted to 0 for these values. Bolt errors are provided in bolt_checks data.frame in your global environment.
| Site_Code | Loc_Code | Loc_Name | Start_Date | QAQC | Year | Plot_Name | Label | Spp_Name | Spp_Code | Elevation_MLLW_m | elev_first | elev_last | elev_change | Distance_m | PI_Distance | PI_Elevation |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Rock | ROCK | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 0.0 | 4.511030 |
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Rock | ROCK | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 0.3 | 4.486524 |
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Water | WATER | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 0.6 | 4.462018 |
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Rock | ROCK | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 0.9 | 4.437512 |
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Rock | ROCK | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 1.2 | 4.413005 |
| ACAD | BASHAR | Bass Harbor | 2013-06-21 | FALSE | 2013 | T1 | T1 bolt 01 | Rock | ROCK | 4.51103 | 4.51103 | 4.317431 | 0.1935992 | 0 | 1.5 | 4.388499 |
print_head(sumPhotoCover(location = c("BASHAR", "OTTPOI"), target_species = c("Ascophyllum", "Barnacle")))
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Spp_Code | Spp_Name | Category | avg_cover | median_cover | min_cover | max_cover | q25_cover | q75_cover |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ALGBRO | Other Algae - Brown | Species Group | 0.0 | 0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ALGGRE | Other Algae - Green | Species Group | 0.0 | 0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ALGRED | Other Algae - Red | Species Group | 0.0 | 0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ARTCOR | Articulated Corallines | Species Group | 0.0 | 0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ASCEPI | Ascophyllum epibiont | Species Group | 17.6 | 22 | 2 | 27 | 14 | 23 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | Ascophyllum | ASCNOD | Knotted Wrack (A. nodosum) | Species | 65.0 | 63 | 53 | 85 | 56 | 68 |
print_head(sumMotileInvertCounts(park = "ACAD", years = 2013:2021, species = c("CARMAE", "HEMISAN")))
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Spp_Code | Spp_Name | count_total | count_med | count_avg | count_min | count_max | count_l25 | count_u75 | damaged_total | damaged_med | damaged_avg | damaged_min | damaged_max | damaged_l25 | damaged_u75 | notdamaged_total | notdamaged_med | notdamaged_avg | notdamaged_min | notdamaged_max | notdamaged_l25 | notdamaged_u75 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Ascophyllum | CARMAE | Green crab (Carcinus maenas) | 6 | 0 | 1.2 | 0 | 4 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 1.2 | 0 | 4 | 0 | 2 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Ascophyllum | HEMISAN | Asian shore crab (H. sanguineus) | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Barnacle | CARMAE | Green crab (Carcinus maenas) | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Barnacle | HEMISAN | Asian shore crab (H. sanguineus) | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Fucus | CARMAE | Green crab (Carcinus maenas) | 1 | 0 | 0.2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0.2 | 0 | 1 | 0 | 0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2019-06-11 | 2019 | FALSE | Fucus | HEMISAN | Asian shore crab (H. sanguineus) | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 |
Measurements are summarized into 5mm bins.
print_head(sumMotileInvertMeas(location = "SHIHAR", years = 2013:2019))
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Spp_Code | Spp_Name | Meas_5mm_fac | num_meas |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | LITLIT | Common periwinkle (Littorina littorea) | 10 to 14.9 | 1 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | LITOBT | Smooth periwinkle (Littorina obtusata) | 5 to 9.9 | 13 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | LITOBT | Smooth periwinkle (Littorina obtusata) | 10 to 14.9 | 28 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | NUCLAP | Dogwhelk (Nucella lapillus) | 15 to 19.9 | 1 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | NUCLAP | Dogwhelk (Nucella lapillus) | 20 to 24.9 | 11 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Ascophyllum | NUCLAP | Dogwhelk (Nucella lapillus) | 25 to 29.9 | 14 |
print_head(sumEchinoCounts(park = "ACAD", years = 2013:2021, species = "STRDRO"))
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Spp_Code | Spp_Name | count_total | count_med | count_avg | count_min | count_max | count_l25 | count_u75 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2013-06-21 | 2013 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 0 | 0 | 0.0000000 | 0 | 0 | 0 | 0.0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2014-06-21 | 2014 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 12 | 0 | 4.0000000 | 0 | 12 | 0 | 6.0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2015-06-12 | 2015 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 5 | 0 | 1.6666667 | 0 | 5 | 0 | 2.5 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2016-06-28 | 2016 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 2 | 0 | 0.6666667 | 0 | 2 | 0 | 1.0 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2017-06-25 | 2017 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 15 | 0 | 5.0000000 | 0 | 15 | 0 | 7.5 |
| Acadia NP | ACAD | Bass Harbor | BASHAR | 2018-05-18 | 2018 | FALSE | STRDRO | Strongylocentrotus droebachiensis (sea urchin) | 18 | 0 | 6.0000000 | 0 | 18 | 0 | 9.0 |
Measurements are summarized into 5mm bins.
print_head(sumEchinoMeas(location = "SHIHAR", years = 2013:2019))
## Warning
## in
## any(echo$Measurement):
## coercing
## argument
## of type
## 'double'
## to
## logical
| Site_Name | Site_Code | Loc_Name | Loc_Code | Start_Date | Year | QAQC | Target_Species | Spp_Code | Spp_Name | Meas_5mm_fac | num_meas |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | STRDRO | Sea urchin (S. droebachiensis) | 25 to 29.9 | 1 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | STRDRO | Sea urchin (S. droebachiensis) | 55 to 59.9 | 4 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | STRDRO | Sea urchin (S. droebachiensis) | 60 to 64.9 | 1 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | STRDRO | Sea urchin (S. droebachiensis) | 65 to 69.9 | 2 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2013-06-22 | 2013 | FALSE | Echinoderms | STRDRO | Sea urchin (S. droebachiensis) | 75 to 79.9 | 2 |
| Acadia NP | ACAD | Ship Harbor | SHIHAR | 2014-06-20 | 2014 | FALSE | Echinoderms | ASTRUB | Asterias rubens | 5 to 9.9 | 1 |
For most getter and summary functions, there are plotting functions with the same suffix. Examples are below.
These plots combine the point intercept data (dots and symbols on the graph) and the photoplot cover data (pie charts) to compare changes across years.
plotSpeciesContours(location = "BASHAR", years = 2013:2018)
## TableGrob (1 x 2) "arrange": 2 grobs
## z
## 1 1
## 2 2
## cells
## 1 (1-1,1-1)
## 2 (1-1,2-2)
## name
## 1 arrange
## 2 arrange
## grob
## 1 gtable[layout]
## 2 gtable[layout]
Plot the transect contours faceted on transect number
plotPITransects(location = "SHIHAR", years = 2013:2019)
Plot point intercept species detections summarized as median and middle 50% distribution of elevation. There are a lot of arguments to produce different plots and figures. Some of the ones I find most useful are below. Note when years aren’t specified, all years are included by default.
plotPISpecies(location = "BASHAR", facet = T, main_groups = T, plotly = T)
plotPISpecies(park = "BOHA", facet = T, main_groups = T)
plotPISpecies(location = "SHIHAR", rev_axis = T, facet = T)
plotPISpecies(location = "OTTPOI", species = c("FUCSPP", "ASCNOD"), plotly = T)
Plots the photoplot cover summarized as median cover and middle 50% distribution of cover across the photoplots within a target species. Note that there are a lot of arguments that produce different plots and figures (all explained in the help). Here are a few I tend to use the most.
plotPhotoCover(park = "ACAD", target_species = "Barnacle", plotly = T)
plotPhotoCover(location = "LITHUN", main_groups = T)
plotPhotoCover(location = "LITHUN", top_spp = 3)
plotPhotoCover(location = "LITHUN", top_spp = 3, plotly = T, xlab = NULL, plot_title = "Little Hunter")
plotPhotoCover(location = "LITHUN", main_groups = T, target_species = "Fucus", plotly = T)
plotPhotoCover(location = "BASHAR", main_groups = T, heatmap = TRUE)
Plot the Counts
plotMotileInvertCounts(location = "OUTBRE", years = 2013:2021)
plotMotileInvertCounts(location = "OUTBRE", years = 2013:2021, plotly = T)
Plot the measurements
plotMotileInvertMeas(location = "SHIHAR", years = 2013:2019)
Plot the Counts
plotEchinoCounts(location = "OUTBRE", years = 2013:2021)
plotEchinoCounts(location = "OUTBRE", years = 2013:2021, plotly = T)
Plot the measurements
plotEchinoMeas(location = "SHIHAR", years = 2013:2019)
plotWaterTemp(park = "ACAD", years = 2022, facet_col = 1)
plotWaterTemp(location = "BASHAR", years = 2011:2022)
plotBuoyData(park = "ACAD", metric = 'all')
## TableGrob (2 x 1) "arrange": 2 grobs
## z
## 1 1
## 2 2
## cells
## 1 (1-1,1-1)
## 2 (2-2,1-1)
## name
## 1 arrange
## 2 arrange
## grob
## 1 gtable[layout]
## 2 gtable[layout]
plotBuoyData(park = "ACAD", metric = "temp", year = 2022)
The default ggplot aesthetics are too busy, and require several lines
of code to turn off. For every package, I create a theme that turns
those off and can just be run with the ggplot code. For this package use
theme_rocky() as shown below.
dat <- sumPhotoCover(location = "SHIHAR", target_species = "Ascophyllum", species = "ASCNOD")
library(ggplot2)
ggplot(dat, aes(x = Year, y = median_cover)) +
geom_point() +
theme_rocky()